3 Building for Ubuntu platform is remarkably easy.
4 This document is tested and based on the latest Ubuntu 20.04 LTS release and can also be used for WSL.
6 ### Clone betaflight repository and install toolchain
10 $ sudo apt install build-essential
11 $ git clone https://github.com/betaflight/betaflight.git
13 $ make arm_sdk_install
15 ### Updating and Rebuilding Firmware
17 Navigate to your local betaflight repository and use the following steps to pull the latest changes and rebuild your version of betaflight:
20 $ make clean TARGET=MATEKF405
21 $ make TARGET=MATEKF405 [OPTIONS=RANGEFINDER] [DEBUG=DBG]
23 Using the optional OPTIONS parameters you can specify options like RANGEFINDER.
24 Using the optional DEBUG parameter you can specify the debugger.
26 You'll see a set of files being compiled, and finally linked, yielding both an ELF and then a HEX.
27 You can use the Betaflight-Configurator to flash the `obj/betaflight_MATEKF405.hex` file.
28 Make sure to remove `obj/` and `make clean`, before building again.
30 ### Building Betaflight Configurator
32 See [Betaflight Configurator Development](https://github.com/betaflight/betaflight-configurator#development) for how to build the Betaflight Configurator.
34 ### Flashing a target with Betaflight Configurator on Ubuntu 20.04
36 In most Linux distributions the user won't have access to serial interfaces by default. Flashing a target requires configuration of usb for dfu mode. To add this access right type the following command in a terminal:
38 $ sudo usermod -a -G dialout $USER
39 $ sudo usermod -a -G plugdev $USER
40 $ sudo apt-get remove modemmanager
41 $ (echo '# DFU (Internal bootloader for STM32 MCUs)'
42 echo 'ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev"') | sudo tee /etc/udev/rules.d/45-stdfu-permissions.rules > /dev/null
44 Please log out and log in to active the settings. You should now be able to flash your target using Betaflight Configurator.
47 Credit goes to K.C. Budd, AKfreak for testing, and pulsar for doing the long legwork that yielded the original content of this document.